<?php
include_once('../bootstrap.php');
$gallery = Doctrine::getTable('gallery')->find($_POST['id']);
foreach($gallery->imagenes as $img) {
    @unlink(INC.'content/photography/'.$gallery->photography->uri.'/'.$img->src);
    @unlink(INC.'content/productos/thumbnail/'.$gallery->photography->uri.'/'.$img->src);
    $img->delete();
}
$gallery->delete();
?>
